package org.wisdom.data.jpa.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.wisdom.data.jpa.support.WisdomMultiTenantDataSourceProperties;

/**
 * 数据源配置类
 *
 * @author 张智研
 * @date 2022/05/26 22:33
 **/
@Configuration
@ConditionalOnProperty(prefix = "wisdom", name = "multi_tenant", havingValue = "true")
@PropertySource(value = {"classpath:multi_tenant.properties"}, encoding = "utf-8")
@EnableConfigurationProperties({WisdomMultiTenantDataSourceProperties.class})
public class DataSourceConfiguration {}
